package com.wbc.smartHome.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Component
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "商品模型类")
public class  Commodity implements Serializable {
    @ApiModelProperty(value = "商品id")
    private Integer id;//商品id
    @ApiModelProperty(value = "商品类型id")
    private Integer typeId;//商品类型id
    @ApiModelProperty(value = "商品类型")
    private String typeName;//商品类型id
    @ApiModelProperty(value = "封面图")
    private String img;//封面图
    @ApiModelProperty(value = "生产地")
    private String address;//生产地
    @ApiModelProperty(value = "商品名字")
    private String name;//商品名字
    @ApiModelProperty(value = "商品介绍")
    private String content;//商品介绍
    @ApiModelProperty(value = "现价")
    private double nowPrice;//现价
    @ApiModelProperty(value = "原价")
    private double firstPrice;//原价
    @ApiModelProperty(value = "标签集合")
    private List<CommodityLabel> commodityLabelList;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//接收前端提交数据的日期格式
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")//后端向前端转json时的日期格式
    @ApiModelProperty(value = "创建时间")
    private Date operTime;//创建时间
    @ApiModelProperty(value = "操作人")
    private String adminName;
    @ApiModelProperty(value = "关键字")
    private String title;
    @ApiModelProperty(value = "当前页码显示")
    private Integer pageNo;//当前页码显示
    @ApiModelProperty(value = "每页显示的数量")
    private Integer pageSize;//每页显示的数量


    @ApiModelProperty(value = "flag=1表示商品")
    private Integer flag = 1;
}
